﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Controles_Curso : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack) BindCBO();
    }

    public string Value
    {
        set {
            try
            {
                ddlCBO.SelectedValue = value;
            }
            catch (Exception e)
            {
                ddlCBO.SelectedIndex = 0;
            }
        }
        get { return ddlCBO.SelectedValue; }
    }
    private void BindCBO()
    {
        DataTable table = SchoolsBI.TipoDocumento.Tabla();
        DataRow dr;
        dr = table.NewRow();
        dr[0] = "-1";
        dr[1] = "Seleccione...";
        table.Rows.InsertAt(dr, 0);
        try
        {
            ddlCBO.DataSource = table;
            ddlCBO.DataTextField = "TipoDocumentoDesc";
            ddlCBO.DataValueField = "IdTipoDoc";
            ddlCBO.DataBind();
        }
        catch (Exception ee)
        {

        }
    }
}
